home *** CD-ROM | disk | FTP | other *** search
-
- function units_ponton_setup()
- units_setup(4,false,nil,ENET_GEOMETRY_PONTON_SHADOW)
- local unit = uniGetExecutor()
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNITBOARDTOTARGET,MATH_INFINITY,uniGetTarget()))
- unit:addSimpleEffect(ENET_PONTON_GROUND):setVisibility(false,false)
- unit:addSimpleEffect(ENET_EFFECT_PS_PONTON_SMOKE)
- end
-
- function units_ponton_resetup()
- units_setup(4,false,nil,ENET_GEOMETRY_PONTON_SHADOW)
- local unit = uniGetExecutor()
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNITBOARDTOTARGET,MATH_INFINITY,uniGetTarget()))
- unit:addSimpleEffect(ENET_PONTON_GROUND):setVisibility(false,false)
- unit:addSimpleEffect(ENET_EFFECT_PS_PONTON_SMOKE)
- end
-
- function units_ponton_select()
- units_select(12,1)
- end
-
- function units_ponton_unselect()
- units_unselect()
- end
-
- function units_ponton_selectenemy()
- uniGetExecutor():addSimpleEffect(ENET_EFFECT_SELECTEDGEOMETRY_ENEMY)
- end
-
- function units_ponton_damaged()
- uniGetExecutor():applyDamage(uniGetLife())
- end
-
- function units_ponton_highlight()
- uniGetExecutor():addEffectWithRadius(ENET_EFFECT_GEOMETRY_HIGHLIGHT,15)
- end
-
- function units_ponton_explode()
- units_explode_water1()
- end
-
- function units_ponton_move()
- local unit = uniGetExecutor()
- local down_engine1 = unit:getBone(ENBT_FIRE1,0):addSimpleEffect(ENET_EFFECT_PS_PONTON_ENGINE)
- local down_engine2 = unit:getBone(ENBT_FIRE1,1):addSimpleEffect(ENET_EFFECT_PS_PONTON_ENGINE)
- local down_engine3 = unit:getBone(ENBT_FIRE1,2):addSimpleEffect(ENET_EFFECT_PS_PONTON_ENGINE)
- local down_engine4 = unit:getBone(ENBT_FIRE1,3):addSimpleEffect(ENET_EFFECT_PS_PONTON_ENGINE)
- unit:addAnimationToQueue(ENAT_GO,MATH_INFINITY)
- waitDeath(unit:addMoveEffect(ENET_EFFECT_MOVE_LINEAR,100))
-
- down_engine1:suspendedDestroy(1.5)
- down_engine2:suspendedDestroy(1.5)
- down_engine3:suspendedDestroy(1.5)
- down_engine4:suspendedDestroy(1.5)
-
- end
-
- function units_ponton_fire()
- end
-
- function units_ponton_unload()
- local unit = uniGetExecutor()
- local pos = uniGetPosition()
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNITBOARDTOTARGET,MATH_PI * 0.7,uniGetTarget()))
- unit:addAnimationToQueue(ENAT_PREPAREFORFIRE1,1)
- unit:setCurrentAnimationRepeatCount(0)
- unit:addSimpleEffect(ENET_PONTON_GROUND):setVisibility(false,false)
- end
-
- registerCommand(ENSCRIPTSET_PONTON,ENC_MOVE,"units_ponton_move")
- registerCommand(ENSCRIPTSET_PONTON,ENC_FIRE1,"units_ponton_fire")
- registerCommand(ENSCRIPTSET_PONTON,ENC_FIRE2,"units_ponton_fire")
- registerCommand(ENSCRIPTSET_PONTON,ENC_SELECT,"units_ponton_select")
- registerCommand(ENSCRIPTSET_PONTON,ENC_SELECTENEMY,"units_ponton_selectenemy")
- registerCommand(ENSCRIPTSET_PONTON,ENC_UNSELECT,"units_ponton_unselect")
- registerCommand(ENSCRIPTSET_PONTON,ENC_SETUP,"units_ponton_setup")
- registerCommand(ENSCRIPTSET_PONTON,ENC_RESETUP,"units_ponton_resetup")
- registerCommand(ENSCRIPTSET_PONTON,ENC_DAMAGED,"units_ponton_damaged")
- registerCommand(ENSCRIPTSET_PONTON,ENC_EXPLODE,"units_ponton_explode")
- registerCommand(ENSCRIPTSET_PONTON,ENC_HIGHLIGHT,"units_ponton_highlight")
- registerCommand(ENSCRIPTSET_PONTON,ENC_INSIDE,"units_inside")
- registerCommand(ENSCRIPTSET_PONTON,ENC_UNLOAD,"units_ponton_unload")
-
- -- make description of unit
- desc = getEffectDescriptionP(ENET_UNIT_PONTON)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "ponton.rmd"
- desc.ScriptSet = ENSCRIPTSET_PONTON
- desc.MoveType = ENMOVE_SWIM
- desc.RenderType = ENRENDERTYPE_GEOMETRY
- desc.Material = ENMAT_RIGIDSKINNEDMESH
- desc.MaterialColors = units_materialcolors_human
-
- -- shadow
- desc = getEffectDescriptionP(ENET_GEOMETRY_PONTON_SHADOW)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "ponton_shadow.rmd"
- desc.RenderType = ENRENDERTYPE_SHADOW
- desc.Material = ENMAT_SHADOW
- desc.MaterialColors = units_materialcolors_shadow
-
- -- register new unit to logic
- unitDesc = logic_getUnitDescP(88)
- unitDesc.group = 1
- unitDesc.order = 2
- unitDesc.unit_res_id = ENET_UNIT_PONTON
- unitDesc.unit_icon_id = "Battleship_h_small_normal.dds"
- unitDesc.active_id = "Battleship_h_small_active.dds"
- unitDesc.pressed_id = "Battleship_h_small_pressed.dds"
- unitDesc.big_icon_id = "Pontoon_bridge_ico.dds"
- unitDesc.small_icon_id = "Battleship_u_stats.dds"
- unitDesc.HP = 1
- unitDesc.MP = 0
- unitDesc.WR = 0
- unitDesc.min_WR = 0
- unitDesc.WD = 0
- unitDesc.WR2 = 0
- unitDesc.min_WR2 = 0
- unitDesc.WD2 = 0
- unitDesc.ability = 3
- unitDesc.transport = 0
- unitDesc.value = 5
- unitDesc.race = 0
- unitDesc.fire_pause = 2.0
- unitDesc.move_pause = 1.0
- unitDesc.unit_info_scale = 0.04
- unitDesc.scn_name = "PONTON"
-
-
- ------------------------------------------------------------------------------------------------------
- ------------------------ effects related to unit------------------------------------------------------
- ------------------------------------------------------------------------------------------------------
- desc = getEffectDescription(ENET_EFFECT_GEOMETRY_VEGETATION_FURPALM)
- desc.FileName = "ponton_ground.smd"
- desc.effectUsageType = ENEUT_GENERIC
- desc.Geometry.isCollisionable = true
- changeEffect(ENET_PONTON_GROUND,desc)
-